from configparser import ConfigParser


def load_config(path: str = "../config.ini"):
    """ 返回一个解析后参数字典 """
    cfg = ConfigParser()
    cfg.read(path, encoding='utf8')
    config = {}
    for section in cfg.sections():
        config[section] = dict(cfg.items(section))
    return config


if __name__ == "__main__":
    cfg = load_config()
    print(cfg)
